<!DOCTYPE html>  
<html lang="en">  
<head>  
    <meta charset="UTF-8">  
    <title>Flask Demo</title>  
    <script>  
        function navigate(direction) {  
            if (direction === 'forward') {  
                fetch('/forward', {  
                method: 'POST'  
            })    
            } else if (direction === 'back') {  
                fetch('/back', {  
                method: 'POST'  
            }) 
            } else if (direction === 'turnLeft') {  
                fetch('/turnLeft', {  
                method: 'POST'  
            }) 
            } else if (direction === 'turnRight') {  
                fetch('/turnRight', {  
                method: 'POST'  
            }) 
            } else if (direction === 'stop') {  
                fetch('/stop', {  
                method: 'POST'  
            }) 
            } 

        }  
    </script>  
</head>  
<body>  
    <button onclick="navigate('forward')">前进</button>  
    <button onclick="navigate('back')">后退</button>  
    <button onclick="navigate('turnLeft')">左转</button>  
    <button onclick="navigate('turnRight')">右转</button>  
    <button onclick="navigate('stop')">停止</button>
</body>  
</html>